<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>帖子详情</title>

    <link
      rel="shortcut icon"
      href="https://static.jyshare.com/images/favicon.ico"
    />
    <link
      rel="stylesheet"
      href="//at.alicdn.com/t/c/font_4522611_wieqaqu8q4.css"
    />

    <link rel="stylesheet" href="<?php echo DIR_PUBLIC; ?>/css/reset.css" />
    <link rel="stylesheet" href="<?php echo DIR_PUBLIC; ?>/css/public.css" />
    <link rel="stylesheet" href="<?php echo DIR_PUBLIC; ?>/css/show.css" />
  </head>

  <body>
    <div class="header">
      <div class="logo">
        <a href="http://127.24.6.11/">智慧璇玑</a>
      </div>
      <div class="banner">
        <a href="http://127.24.6.11/">首页</a>
        <a href="<?php echo DIR_MODEL; ?>/publish.php">新帖</a>
        <a href="<?php echo DIR_MODEL; ?>/list_father.php">话题</a>
      </div>
      <div class="put">
        <form action="<?php echo DIR_MODEL; ?>/list_son.php">
          <input type="text" name="keyword" />
          <button>搜索</button>
        </form>
      </div>
      <ul>
        <li>
          <a href="<?php echo DIR_MODEL; ?>/login.php">登录</a>&nbsp;/&nbsp;
          <a href="<?php echo DIR_MODEL; ?>/register.php">注册</a>
        </li>
        <li>
          <a href="<?php echo DIR_MODEL; ?>/upload_img.php">
            <span class="iconfont icon-geren"></span>&nbsp;个人中心
          </a>
        </li>
        <li>
          <a href="./logout.php">
            <span class="iconfont icon-kaiguan"></span>&nbsp;注销
          </a>
        </li>
      </ul>
    </div>

    <div class="content">
      <div class="auto">
        <span class="iconfont icon-shouye"></span><a>首页</a> &gt;
        <a>云计算</a> &gt; <a>大数据</a>
        <a href="./reply.php?pub_id=<?php echo $row['pub_id']; ?>">
          <span>回复</span>
        </a>
      </div>

      <?php if($pageNum == 1) : ?>
      <div class="wrapContent" id="wrapContent">
        <div class="left">
          <div class="face">
            <a href="" target="_blank">
              <img
                src="../uploads/images/<?php echo $row['user_image']; ?>"
                alt="头像"
              />
            </a>
          </div>
          <div class="name">
            <a href=""><?php echo $row['pub_owner']; ?></a>
          </div>
        </div>

        <div class="right">
          <div class="title">
            <h2><?php echo $row['pub_title']; ?></h2>
            <p>
              阅读：<?php echo $row['pub_hits']; ?>&nbsp; | &nbsp;回复：<?php echo $rep_num; ?>
            </p>
          </div>
          <div class="pubdate">
            <p class="date">
              发布于：<?php echo date('Y-m-d H:i:s', $row['pub_time']); ?>
            </p>
            <p class="floor">楼主</p>
          </div>
          <div class="context">
            <?php echo $row['pub_content']; ?>
          </div>
        </div>
      </div>
      <?php endIf; ?>

      <?php $i = 5 * $pageNum - 4; while($rep_row = mysql_fetch_assoc($rep_result)) : ?>
      <div class="wrapContent">
        <div class="left">
          <div class="face">
            <a href="#">
              <img
                src="../uploads/images/<?php echo $rep_row['user_image']; ?>"
                alt="头像"
              />
            </a>
          </div>
          <div class="name">
            <a href="#"><?php echo $rep_row['rep_user']; ?></a>
          </div>
        </div>

        <div class="right">
          <div class="pubdate">
            <p class="date">
              回复时间：<?php echo date('Y-m-d H:i:s', $rep_row['rep_time']); ?>
            </p>
            <p class="floor">
              <?php echo $i++; ?>楼&nbsp; | &nbsp;<a
                href="./quote.php?num=<?php echo $i - 1; ?>&pub_id=<?php echo $row['pub_id']; ?>&rep_id=<?php echo $rep_row['rep_id']; ?>"
                >引用</a
              >
            </p>
          </div>
          <div class="context">
            <?php
                if($rep_row['rep_quote_id'] != 0) {
                    $quote_sql = "select * from reply where rep_id = {$rep_row['rep_quote_id']}";
                    $quote_result = my_query($quote_sql);
                    $quote_row = mysql_fetch_assoc($quote_result);
                }
              ?>
            <?php if($rep_row['rep_quote_id'] != 0) : ?>
            <div class="quote">
              <h2>
                引用 <?php echo $rep_row['rep_num']; ?>楼 <?php echo $quote_row['rep_user']; ?> 发表的：
              </h2>
              <p><?php echo $rep_row['rep_content']; ?></p>
            </div>
            <?php endIf; ?>
            <?php echo $rep_row['rep_content']; ?>
          </div>
        </div>
      </div>
      <?php endWhile; ?>
    </div>

    <div class="footer">
      <div class="footer-title">智慧璇玑</div>
      <div class="footer-content">
        Copyright &copy; 2024 智慧璇玑 All Rights Reserved
      </div>
    </div>
  </body>
</html>
